package com.leaf.lowcode.utils;

public class StringUtil {
    public static String strToUnicode(String str) {
        StringBuffer sb = new StringBuffer();
        char[] c = str.toCharArray();
        for (int i = 0; i < c.length; i++) {
            // Integer.toHexString把字符串转16进制
            sb.append("\\u" + Integer.toHexString(c[i]));
        }

        return sb.toString();
    }
}
